<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户管理</title>
</head>



<body>
<form style="margin-top: 150px">
    <button type="button" class="btn btn-primary">添加</button>
    <table class="table table-bordered table-hover"  style="margin-top: 20px">
        <tr>
            <td>ID</td>
            <td>微信ID</td>
            <td>昵称</td>
            <td>性别</td>
            <td>头像</td>
            <td>注册时间</td>
            <td>修改时间</td>
            <td>最后登录时间</td>
            <td>状态</td>

        </tr>
        <tbody id="table">

        </tbody>
    </table>

</form>
</body>
<script src="dist/js/include.js"></script>
<script>
    $.ajax({
        url : "/user/user/list",
        type : 'GET',
        dataType : 'json',
        success : function(data) {
            $.each(data.data,function (index,val) {
                var state;
                if(val.state==1) {
                    state = '显示';
                }else if(val.state==2){
                    state='不显示'
                }
                var html = '<tr>'+
                    '<td>'+val.id+'</td>'+
                    '<td>'+val.wxopenid+'</td>'+
                    '<td>'+val.nickname+'</td>'+
                    '<td>'+val.sex+'</td>'+
                    '<td><img class="img" src="' + val.avatar + '" style=" width:45px"></td>'+
                    '<td>'+sysTime(val.regdate)+'</td>'+
                    '<td>'+sysTime(val.updatedate)+'</td>'+
                    '<td>'+sysTime(val.lastdate)+'</td>'+
                    '<td>'+state+'</td>'+
                    '</tr>';
                $("#table").append(html);
            })

        }
    });

</script>
</html>